package view.viewComponents 
{
	import controller.EventBus;
	import controller.TimerModelEvent;
	import org.flixel.FlxSprite;
	
	/**
	 * ...
	 * @author Gaz Williams
	 * 
	 * the timer displays how long the player has remaining on this earth...
	 * 
	 */
	public class TimerComponent extends FlxSprite 
	{
		
		private var bus:EventBus;
		
		public function TimerComponent(X:Number=0, Y:Number=0, SimpleGraphic:Class=null) 
		{
			super(X, Y, SimpleGraphic);
			
			bus = EventBus.getInstance();
			bus.addEventListener(TimerModelEvent.TIME_UPDATED, handleTimerUpdated);
			
		}
		
		override public function destroy():void 
		{
			bus.removeEventListener(TimerModelEvent.TIME_UPDATED, handleTimerUpdated);
		}
		
		private function handleTimerUpdated(e:TimerModelEvent):void 
		{
			//UPDATE graphics
		}
		
	}

}